package a3_ford_fulkerson_test;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.Test;

import a1_graph_lib.AIGraph;
import a1_graph_lib.AIGraphCounter;
import a1_reader.GraphReader;
import a2_bellman_ford.Bellman_Ford_Algorithmus;

public class Ford_Fulkerson_test {
	
	
	
	
	@Test
	public void test_1() {
		
		final String pfad2 = "Z:\\win7\\GKA\\GKA_P\\src\\graphen\\a3test1";
		AIGraph graphI = new AIGraph();
		graphI = GraphReader.readGraph(graphI, pfad2);
		AIGraphCounter graph = new AIGraphCounter(graphI);
		graph = a3_ford_fulkerson.Ford_Fulkerson.ford_fulkerson(graph, 0, 5);
		assertEquals(4, a3_ford_fulkerson.Ford_Fulkerson.getAktuellenFlussVonVerticeWeck(graph, 0));
	}

	@Test
	public void test_2() {
		
		final String pfad2 = "Z:\\win7\\GKA\\GKA_P\\src\\graphen\\a3test2";
		AIGraph graphI = new AIGraph();
		graphI = GraphReader.readGraph(graphI, pfad2);
		AIGraphCounter graph = new AIGraphCounter(graphI);
		graph = a3_ford_fulkerson.Ford_Fulkerson.ford_fulkerson(graph, 0, 2);
		assertEquals(4, a3_ford_fulkerson.Ford_Fulkerson.getAktuellenFlussVonVerticeWeck(graph, 0));
	}
	
	@Test
	public void test_3() {
		
		final String pfad2 = "Z:\\win7\\GKA\\GKA_P\\src\\graphen\\a3test3";
		AIGraph graphI = new AIGraph();
		graphI = GraphReader.readGraph(graphI, pfad2);
		AIGraphCounter graph = new AIGraphCounter(graphI);
		graph = a3_ford_fulkerson.Ford_Fulkerson.ford_fulkerson(graph, 0, 7);
		assertEquals(20, a3_ford_fulkerson.Ford_Fulkerson.getAktuellenFlussVonVerticeWeck(graph, 0));
	}
	
	@Test
	public void test_4() {
		
		final String pfad2 = "Z:\\win7\\GKA\\GKA_P\\src\\graphen\\a3test4";
		AIGraph graphI = new AIGraph();
		graphI = GraphReader.readGraph(graphI, pfad2);
		AIGraphCounter graph = new AIGraphCounter(graphI);
		graph = a3_ford_fulkerson.Ford_Fulkerson.ford_fulkerson(graph, 0, 7);
		assertEquals(20, a3_ford_fulkerson.Ford_Fulkerson.getAktuellenFlussVonVerticeWeck(graph, 0));
	}
	
	@Test
	public void test_1_kein_fluss() {
		
		final String pfad2 = "Z:\\win7\\GKA\\GKA_P\\src\\graphen\\a3test4";
		AIGraph graphI = new AIGraph();
		graphI = GraphReader.readGraph(graphI, pfad2);
		AIGraphCounter graph = new AIGraphCounter(graphI);
		graph = a3_ford_fulkerson.Ford_Fulkerson.ford_fulkerson(graph, 7, 0);
		assertEquals(0, a3_ford_fulkerson.Ford_Fulkerson.getAktuellenFlussVonVerticeWeck(graph, 7));
	}

	
}


